from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
import sys
# 帮我们直接运行此文件时，可以加载到上级目录的ui包
sys.path.append("../")

from ui.Ui_game_center_widget import Ui_GameCenterWidget
from game_dialog import GameDialog

class GameCenterWidget(QWidget):

    def __init__(self, parent=None):
        super().__init__(parent)
        self.ui = Ui_GameCenterWidget()
        self.ui.setupUi(self)

        self.init_ui()

    def on_btn_single(self):
        game = GameDialog(self)
        game.exec_()
    
    def on_btn_multi(self):
        pass

    def init_ui(self):
        self.ui.btn_single.clicked.connect(self.on_btn_single)
        self.ui.btn_multi.clicked.connect(self.on_btn_multi)


if __name__ == '__main__':
    app = QApplication(sys.argv)

    window = GameCenterWidget()
    window.show()

    sys.exit(app.exec_())